package kodkod.engine.fol2sat.ordering;

import kodkod.engine.satlab.OrderableSolver;

/**
 * Uniformly initialize SAT solver's internal score to prioritize primary variables
 * @author Markus Iser
 *
 */
public class InitializePrimaryVariables extends OrderingMethod {
	
	double priority = 3.0;
	
	/**
	 * Initialize the SAT solver's internal score for primary variables with a value of 3.0
	 */
	public InitializePrimaryVariables() { }
	
	/**
	 * Initialize SAT solver's internal score for primary variables
	 * @param priority specifies the value used to initialize the SAT solver's internal score
	 */
	public InitializePrimaryVariables(double priority) {
		this.priority = priority;
	}

	@Override
	public void apply(OrderableSolver solver, int primaryVars) {
		for (int var = 0; var < primaryVars; var++) {
			solver.initializeOrder(var, priority);
		}
	}
}
